home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Software Contest 3 / FM Towns Software Contest 3.iso / exp / astral / a1 / game / source / sprsub.c < prev    next >
C/C++ Source or Header  |  1994-01-07  |  2KB  |  80 lines

  1. #include <spr.h>
  2. #include "scmds.h"
  3.  
  4. void put_count(int w)
  5. {
  6.     SPR_set_att(896+123,1,1,(128+2+(w/10000)),0x8100);
  7.     w%=10000;
  8.     SPR_set_att(896+124,1,1,(128+2+(w/1000)),0x8100);
  9.     w%=1000;
  10.     SPR_set_att(896+125,1,1,(128+2+(w/100)),0x8100);
  11.     w%=100;
  12.     SPR_set_att(896+126,1,1,(128+2+(w/10)),0x8100);
  13.     w%=10;
  14.     SPR_set_att(896+127,1,1,(128+2+(w)),0x8100);
  15. }
  16.  
  17. void put_score(int w)
  18. {
  19.     SPR_set_att(896+112,1,1,(128+2+(w/100000000)),0x8100);
  20.     w%=10000000;
  21.     SPR_set_att(896+113,1,1,(128+2+(w/1000000)),0x8100);
  22.     w%=1000000;
  23.     SPR_set_att(896+114,1,1,(128+2+(w/100000)),0x8100);
  24.     w%=100000;
  25.     SPR_set_att(896+115,1,1,(128+2+(w/10000)),0x8100);
  26.     w%=10000;
  27.     SPR_set_att(896+116,1,1,(128+2+(w/1000)),0x8100);
  28.     w%=1000;
  29.     SPR_set_att(896+117,1,1,(128+2+(w/100)),0x8100);
  30. }
  31.  
  32. void putstrg(int x,int y,int spr_num,char *str,int num)
  33. {
  34.     int i;
  35.     
  36.     for(i=0;i<num;i++){
  37.         if(str[i]>='A' && str[i]<='Z'){
  38.             SPR_set_att_pos(spr_num+i,1,1,128+14+(str[i]-'A'),0x8100,x+i*8,y);
  39.             continue;
  40.         }
  41.         if(str[i]=='!'){
  42.             SPR_set_att_pos(spr_num+i,1,1,128+14+26,0x8100,x+i*8,y);
  43.             continue;
  44.         }
  45.         if(str[i]==':'){
  46.             SPR_set_att_pos(spr_num+i,1,1,128+14+27,0x8100,x+i*8,y);
  47.             continue;
  48.         }
  49.         if(str[i]==','){
  50.             SPR_set_att_pos(spr_num+i,1,1,128+14+28,0x8100,x+i*8,y);
  51.             continue;
  52.         }
  53.         if(str[i]=='\''){
  54.             SPR_set_att_pos(spr_num+i,1,1,128+14+29,0x8100,x+i*8,y);
  55.             continue;
  56.         }
  57.         if(str[i]=='.'){
  58.             SPR_set_att_pos(spr_num+i,1,1,128+14+30,0x8100,x+i*8,y);
  59.             continue;
  60.         }
  61.         if(str[i]=='>'){
  62.             SPR_set_att_pos(spr_num+i,1,1,128+14+31,0x8100,x+i*8,y);
  63.             continue;
  64.         }
  65.         else{
  66.             SPR_set_att(spr_num+i,1,1,0,0x2000);
  67.             continue;
  68.         }
  69.     }
  70. }
  71.  
  72. void put_shield(int shield)
  73. {
  74.     int i;
  75.     
  76.     for(i=shield;i<4;i++){
  77.         SPR_set_att(896+98+i,1,1,0,0x2000);
  78.     }
  79. }
  80.